package com.cadre.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cadre.common.utils.oldutil.PageUtils;
import com.cadre.common.utils.oldutil.Query;
import com.cadre.system.domain.officer.PostchangeEntity;
import com.cadre.system.mapper.PostchangeMapper;
import com.cadre.system.service.PostchangeService;
import org.elasticsearch.common.collect.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

@Service("postchangeService")
public class PostchangeServiceImpl extends ServiceImpl<PostchangeMapper, PostchangeEntity> implements PostchangeService {
    @Autowired
    private PostchangeMapper postchangeMapper;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        return new PageUtils(this.baseMapper.selectPage(new Query(params).getPage(), new LambdaQueryWrapper<>()));
    }

    @Override
    @Transactional(rollbackFor = {Exception.class})
    public int updateByPrimaryKeySelective(PostchangeEntity postchangeEntity) {
        return this.baseMapper.updateByPrimaryKeySelective(postchangeEntity);
    }

    @Override
    public java.util.List<PostchangeEntity> selectByMaps(Map<String, Object> map) {
        return this.postchangeMapper.selectByMaps(map);
    }
}
